home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH6 / 6-2-2.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-18  |  2.1 KB  |  73 lines

  1. VERSION 5.00
  2. Begin VB.Form frmPhone 
  3.    Caption         =   "Phone Number"
  4.    ClientHeight    =   1725
  5.    ClientLeft      =   1215
  6.    ClientTop       =   1650
  7.    ClientWidth     =   2655
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form1"
  18.    PaletteMode     =   1  'UseZOrder
  19.    ScaleHeight     =   1725
  20.    ScaleWidth      =   2655
  21.    Begin VB.TextBox txtName 
  22.       Height          =   285
  23.       Left            =   1680
  24.       TabIndex        =   1
  25.       Top             =   120
  26.       Width           =   855
  27.    End
  28.    Begin VB.PictureBox picNumber 
  29.       Height          =   255
  30.       Left            =   120
  31.       ScaleHeight     =   195
  32.       ScaleWidth      =   2355
  33.       TabIndex        =   3
  34.       Top             =   1320
  35.       Width           =   2415
  36.    End
  37.    Begin VB.CommandButton cmdDisplay 
  38.       Caption         =   "Display Phone Number"
  39.       Height          =   495
  40.       Left            =   120
  41.       TabIndex        =   2
  42.       Top             =   600
  43.       Width           =   2415
  44.    End
  45.    Begin VB.Label lblName 
  46.       Alignment       =   1  'Right Justify
  47.       Caption         =   "Name to look up"
  48.       Height          =   255
  49.       Left            =   120
  50.       TabIndex        =   0
  51.       Top             =   120
  52.       Width           =   1455
  53.    End
  54. Attribute VB_Name = "frmPhone"
  55. Attribute VB_GlobalNameSpace = False
  56. Attribute VB_Creatable = False
  57. Attribute VB_PredeclaredId = True
  58. Attribute VB_Exposed = False
  59. Private Sub cmddisplay_Click()
  60.   Dim nom As String, phoneNum As String
  61.   Open App.Path & "\PHONE.TXT" For Input As #1
  62.   Do While (nom <> txtName.Text) And (Not EOF(1))
  63.     Input #1, nom, phoneNum
  64.   Loop
  65.   Close #1
  66.   picNumber.Cls
  67.   If nom = txtName.Text Then
  68.       picNumber.Print nom, phoneNum
  69.     Else
  70.       picNumber.Print "Name not found."
  71.   End If
  72. End Sub
  73.